﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class MetadataFactor : MetadataSingleArgumentSuffix<Expression>
{
    internal MetadataFactor(SyntaxToken factorKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataFactor,
            factorKeywordToken,
            NodeConverter.ToIdentifier(factorKeywordToken),
            parent)
    {
    }
}


public static partial class NodeFactory
{
    public static MetadataFactor CreateMetadataFactor(SyntaxNode? parent, SyntaxToken factorKeywordToken,
        Expression? value)
    {
        Debug.Assert(factorKeywordToken.IsNode(SyntaxKinds.FactorKeywordToken));
        MetadataFactor factor = new(factorKeywordToken, parent);
        return UpdateMetadataSingleArgumentSuffix(factor, value);
    }
}